package com.kevin.learn.domain;

public enum CareType {
    ONE_2_ONE(1, "一对一"),
    ONE_2_TWO(2, "一对二"),
    ONE_2_MANY(3, "一对多");


    private String desc;

    private int val;

    CareType(int val, String desc) {
        this.desc = desc;
        this.val = val;
    }

    public int getVal() {
        return val;
    }

    public void setVal(int val) {
        this.val = val;
    }

    public static CareType getEnum(int val) {
        CareType[] enumAry = CareType.values();
        for (int i = 0; i < enumAry.length; i++) {
            if (enumAry[i].getVal() == val) {
                return enumAry[i];
            }
        }
        return null;
    }
}